<?php 
$link = "index.php?com=yahoo_list";
$limit = 20;
$page_show=5;

$baiviets = $y->Yahoo_List('',-1,-1);
$total_record = mysql_num_rows($baiviets);

$total_page = ceil($total_record/$limit);

if(isset($_GET[page])==false){
	$page = 1;
}
else{ 
	$page=$_GET[page];
	settype($page,"int");
}

$offset = $limit * ($page - 1);
$baiviet = $y->Yahoo_List('',$offset,$limit);

?>
<script type="text/javascript">
	$(document).ready(function(){		
		$(".linkxoa").live("click",function(){		
                    var flag = confirm("Bạn có chắc chắn xóa ?");
                    if(flag==true){                           
                        var idYahoo = $(this).attr("idYahoo");
                        $.get('xoa.php',{loai:"yahoo",id:idYahoo},function(data){
                            window.location.reload();			
                        });	
                    }
		})
        
	})
</script>
<style>
#bao_nick  {padding:10px}
#bao_nick a {color:#FFF;background-color:#06F;margin-right:20px;padding:7px;text-decoration:none}
#bao_nick a:hover, #bao_nick a.chon{background-color:#CCC;color:#00F}
#rounded-corners{font-weight:bold}
</style>
<div id="admin_navigation">
	<div style="float:left;width:90%">
		<h3>Quản lý số điện thoại</h3>
    </div>
   <div style="float:left;width:5%;padding-top:5px">
        <a href="index.php?com=yahoo_add"><input type="button" class="new" name="btnNew" value=""/></a><br />		
        <span>New</span>
    </div>
    <div class="clr"></div>
</div>
<div id="main_admin">
	<div>
    <form method="get">
       
    	<fieldset>
        	<legend>++ Danh sách ++</legend>
            	<div style="text-align: center">                     
                    <table id="rounded-corners" summary="2007 Major IT Companies&#39; Profit">
                        <thead>
                        	
                            <tr class="tieudetable">
                            
                                <th scope="col" class="rounded-company"></th>      
                                
                                <th scope="col" class="rounded">Tên</th>  
                                
                                <th scope="col" class="rounded">Điện thoại</th>                                 
                                <th scope="col">Khu vực</th>                                
                                <th scope="col" class="rounded-q4">Sửa</th>
                                <th scope="col" class="rounded-q4">Xóa</th>
                            </tr>
                        </thead>

                        <tbody>
                        <?php 
                      
						$i=0;
                       while($row = mysql_fetch_assoc($baiviet)){                      
					   $i++;
                        ?>	
                            <tr <?php if($i%2==0) echo "bgcolor='#CCC'" ; ?>>
                                <td><input type="checkbox" name="chon" idEmail=<?php echo $row[idYahoo]?>></td>                                         
                                <td align="left"><?php echo $row[Ten];?></td>   
                               
                                <td><?php echo $row[dienthoai];?></td>
                                <td><?php echo $row[loai];?></td>                                
                               
                               <td><a href="index.php?com=yahoo_sua&idYahoo=<?php echo $row[idYahoo]?>"><img src="img/icons/user_edit.png" alt="" title="" border="0"></a></td>
                               <td>
                                	<img class="linkxoa" idYahoo=<?php echo $row[idYahoo]?> src="img/icons/trash.png" alt="" title="" border="0">
                                </td>
                            </tr>
                        <?php } ?>
                       
                        </tbody>
                    </table>
                    </div>
        </fieldset>
    </div>

   
    <div class="clr"></div>
</div>
